typedef struct {
  char *data;
  int size;
} STACK;
void init(STACK *s) {
  data = (char*)malloc(sizeof(char) *DEFAULT_SIZE);
  s->size = 0;
}

void push(STACK *s, char ele) {
  s->data[s->size] = ele;
  ++s->size;
}
void print(STACK *s) {
  int i;
  for (i = 0; i < s->size; i++)
    printf("%c ", s->data[i]);
  printf("\n");
}

char top(STACK *s) {
  return s->data[s->size - 1];
}

void pop(STACK *s, char *val) {
  *val = top(s);
  s->size--;
}

int isEmpty(STACK *s) {
  return s->size == 0;
}

int main() {
  STACK s;
  init(&s);
  int i;
  for (i = 0; i <= 7; i++) {
    push(&s, 'a' + i);
  }
  char c;
  while (!isEmpty(&s)) {
    pop(&s, &c);
    putchar(c);
  }
  return 0;
}
